from appium import webdriver
from appium.webdriver.common.touch_action import TouchAction

desired_caps = {
    'platformName': 'Android',
    'platformVersion': '6.0',
    'deviceName': '192.168.56.109:5555',
    'appPackage': 'com.android.settings',
    'appActivity': '.Settings',
    'resetKeyBoard': True,
    'unicodeKeyboard': True,
    'noReset': True,
    'automationName': 'Uiautomator2'
}

driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
TouchAction(driver).press(x=476, y=1622).move_to(x=573, y=410).release().perform()

el1 = driver.find_element_by_xpath(
    "/hierarchy/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[2]/android.widget.FrameLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.view.ViewGroup/android.widget.FrameLayout[1]/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.TextView")
el1.click()

driver.close_app()
driver.quit()